package com.shanxi.cz.module.biz.dal.mysql.ammeterrecordyear;

import java.util.*;

import com.shanxi.cz.framework.common.pojo.PageResult;
import com.shanxi.cz.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.shanxi.cz.framework.mybatis.core.mapper.BaseMapperX;
import com.shanxi.cz.module.biz.dal.dataobject.ammeterrecordmonth.AmmeterRecordMonthDO;
import com.shanxi.cz.module.biz.dal.dataobject.ammeterrecordyear.AmmeterRecordYearDO;
import org.apache.ibatis.annotations.Mapper;
import com.shanxi.cz.module.biz.controller.admin.ammeterrecordyear.vo.*;

/**
 * 电表数据年报 Mapper
 *
 * @author admin
 */
@Mapper
public interface AmmeterRecordYearMapper extends BaseMapperX<AmmeterRecordYearDO> {

    default PageResult<AmmeterRecordYearDO> selectPage(AmmeterRecordYearPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AmmeterRecordYearDO>()
                .eqIfPresent(AmmeterRecordYearDO::getAmmeterId, reqVO.getAmmeterId())
                .eqIfPresent(AmmeterRecordYearDO::getRecordYear, reqVO.getRecordYear())
                .eqIfPresent(AmmeterRecordYearDO::getHz, reqVO.getHz())
                .eqIfPresent(AmmeterRecordYearDO::getVoltageA, reqVO.getVoltageA())
                .eqIfPresent(AmmeterRecordYearDO::getVoltageB, reqVO.getVoltageB())
                .eqIfPresent(AmmeterRecordYearDO::getVoltageC, reqVO.getVoltageC())
                .eqIfPresent(AmmeterRecordYearDO::getElectricityA, reqVO.getElectricityA())
                .eqIfPresent(AmmeterRecordYearDO::getElectricityB, reqVO.getElectricityB())
                .eqIfPresent(AmmeterRecordYearDO::getElectricityC, reqVO.getElectricityC())
                .eqIfPresent(AmmeterRecordYearDO::getPower, reqVO.getPower())
                .eqIfPresent(AmmeterRecordYearDO::getEng, reqVO.getEng())
                .betweenIfPresent(AmmeterRecordYearDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AmmeterRecordYearDO::getId));
    }

}